package org.eenie.appseed.ui.bento

import androidx.recyclerview.widget.ConcatAdapter
import com.yelp.android.bento.componentcontrollers.RecyclerViewComponentController
import com.yelp.android.bento.components.ListComponent
import com.yelp.android.bento.components.SimpleComponent
import org.eenie.appseed.databinding.ActivityBentoBinding
import org.eenie.appseed.ui.bento.holder.BannerHolder
import org.eenie.appseed.ui.bento.holder.NewsItemHolder
import org.eenie.core.base.viewbinding.BaseBindingActivity

class BentoActivity : BaseBindingActivity<ActivityBentoBinding>() {

    private val mComponentController by lazy {
        RecyclerViewComponentController(binding.rvBento)
    }

    private val mBannerComponent = SimpleComponent<String>(BannerHolder::class.java)
    private val mNewsComponent = ListComponent(null, NewsItemHolder::class.java).apply {
        toggleDivider(false)
        setData((1..100).map { it.toString() })

    }

    override fun providerBinding() = ActivityBentoBinding.inflate(layoutInflater)
    override fun initUI() {
        mComponentController.addComponent(mBannerComponent)
        mComponentController.addComponent(mNewsComponent)
    }
}